package org.aitrade.xiaok;

import java.text.SimpleDateFormat;

import org.apache.log4j.Logger;

/**
 * Hello world!
 *
 */
public class App {
	public static void main(String[] args) {

		Ai_XiaoK ai_XiaoK = new Ai_XiaoK();

		Logger logger = Logger.getLogger(App.class);

		SimpleDateFormat sformat = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss");

		while (true) {
			try {
				// 每隔5秒检测K线
				String timestr = sformat.format(System.currentTimeMillis());
				logger.info("start Analysis KLine: " + timestr);

				ai_XiaoK.doWork();
				Thread.sleep(2000);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
}
